﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Empires.CRL.DataContract;
using Empires.BLL.Core.IService;
using Empires.BLL.Core.Implement;

namespace Empires.PL.ServiceClient
{
    public static class CompanyNewsServiceClient
    {
        public static List<DefaultDataPack> GetNewsList(string copName, string type, string subject, int page, int size)
        {
            ICompanyNewsService service = new CompanyNewsService();
            return service.GetNewsList(copName, type, subject, page, size);
        }
        public static List<DefaultDataPack> GetNewsDetail(int nid)
        {
            ICompanyNewsService service = new CompanyNewsService();
            return service.GetNewsDetail(nid);
        }
        public static int DeleteNewsItem(string copName, string id)
        {
            int newsid = 0;
            if (Int32.TryParse(id, out newsid))
            {
                ICompanyNewsService service = new CompanyNewsService();
                return service.DeleteNewsItem(copName, newsid);
            }
            return 0;
        }

        public static int AddNewsItem(string cpname,string author, string content, string from, string title)
        {
            ICompanyNewsService service = new CompanyNewsService();
            return service.AddNewsItem(cpname, author, content, from, title);
        }
    }
}
